const roads: Record<string, any> = {
  '54FF6B065187565349420967': [
    { x: 5, y: 1, z: 6 },
    { x: 9, y: 2, z: 12 },
    { x: 9, y: 3, z: 7 },
    { x: 9, y: 4, z: 5 },
    { x: 5, y: 5, z: 3 },
    { x: 5, y: 6, z: 3 },
  ],
};
export function generateDeviceRoads(mcuid: string) {
  const axis: {
    roadNo: string;
    mcuid: string;
    axisY: number;
    axisX: number;
    axisZ: number;
  }[] = [];
  roads[mcuid].forEach((item: any) => {
    for (let i = 1; i < item.x + 1; i++) {
      const obj: any = {};
      let roadNo: string = `${item.y}0${i}`;
      let x = i;
      if (item.x <= 5) roadNo = `${item.y}0${i * 2 - 1}`;
      if (item.x <= 5) x = i * 2 - 1;

      obj.roadNo = roadNo;
      obj.mcuid = mcuid;
      obj.axisZ = item.z;
      obj.axisY = item.y;
      obj.axisX = x;
      axis.push(obj);
    }
  });

  return axis;
}
